 <!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$setting.webname}-我的团队</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico"> 
    <link href="/static/admin/layui/css/layui.css" rel="stylesheet">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet"> -->
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/jsTree/style.min.css" rel="stylesheet">
	<style>
	  .tools a i{
	    color:#19a9d5
	  }
	  .tools a i:hover{
	    text-shadow:0px 0px 5px #19a9d5;
	  }
      #using_json{
        display: inline-block;
        border: none;
      }
      .ibox-content{
        overflow: hidden;
      }
      #searchBtn{
          padding: 5px 30px;
      }
      .myeye {
        margin: 0 5px;
        color: #2196F3;
        font-size: 15px;
      }
	</style>

</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
         <div class="col-sm-4">
             <h2>咨询团队</h2>
             <ol class="breadcrumb">
                 <li>
                     <a href="{:url('Index/admin')}">主页</a>
                 </li>
                 <li>
                     <strong>咨询师</strong>
                 </li>
             </ol>
         </div>
     </div>
    <div class="wrapper wrapper-content animated fadeInRight" style="height: 100%">
        <div class="row" style="height: 100%">
            <div class="col-sm-12">
                <div class="ibox float-e-margins " style="margin-bottom: 10px;">
                    <div class="ibox-title">
                        <h5 >团队成员</h5>
                        <div class="ibox-tools">
                                
                        </div>
                    </div>
                    <div class="ibox-content">
                            <div class="col-sm-4" id="using_json"></div>
                            <div class="input-group col-sm-6">
                                <input type="text" id="searchInput" placeholder="请输入关键词" class="input-sm form-control">
                                <span class="input-group-btn">
                                    <button type="button" id="searchBtn" class="btn btn-sm btn-primary"> 搜索</button> 
                                </span>
                            </div>
                    </div>
                    
                </div>
            </div>
            <iframe class="col-sm-12" id="J_iframe" adminid='-1' scrolling="no" width="100%" height="100%" src="{:url('Counselors/showRes')}" frameborder="0" data-id="" seamless></iframe>
        </div>
    </div>
   

    <!-- 全局js -->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- Peity -->
    <script src="/static/admin/layui/layui.js"></script>

    <!-- jsTree plugin javascript -->
    <script src="/static/admin/js/plugins/jsTree/jstree.min.js"></script>
    <script>
        $(document).ready(function () {


                    //data 第一层 数据数组
                    //有子集 text:'' 文本内容 children:[] 子集 state 是否有下级 默认true为打开，false合并
                    //树加载时 注册事件
                    $('#using_json').jstree({$json}).on('ready.jstree',function(event,data){
                        $('.showRes').on('click',function(){
                            var url = $(this).attr('href');
                            var id = $(this).attr('id');

                            $("#J_iframe").attr({
                                src:url,
                                adminid:id,
                            });

                            //当选中是添加眼镜图标标记当前显示位置
                            var icon = $("<i class='fa fa-eye myeye'></i>");
                            $('.myeye').remove();
                            $(this).append(icon);
                        });
                    }).on("after_open.jstree",function(){
                        $('.showRes').on('click',function(){
                            var url = $(this).attr('href');
                            var id = $(this).attr('id');

                            $("#J_iframe").attr({
                                src:url,
                                adminid:id,
                            });

                            //当选中是添加眼镜图标标记当前显示位置
                            var icon = $("<i class='fa fa-eye myeye'></i>");
                            $('.myeye').remove();
                            $(this).append(icon);
                        });
                    });


                    // 搜索框 
                    layui.use(['layer'], function () {  //点击搜索按钮进行搜索
                        $('#searchBtn').click(function(){
                            var e = $(this);
                            var id = $('#J_iframe').attr('adminid');
                            var key = e.parent('span').prevAll('input').val();
                            var url = "{:url('Counselors/showres')}?id="+id+"&key="+key;
                            // if(key == '') return false;
                            $("#J_iframe").attr({
                                src:url,
                            });
                            var loading = layer.load(1);
                        });

                    });

                    var inputTips;
                    $('#searchInput').focus(function(){  //获取焦点时 显示提示
                        var that = $(this);
                        inputTips = layer.tips('搜索条件 编号/联系方式/姓名/邮箱', that, {tips: 1,time:false});
                    }).blur(function() {
                        layer.close(inputTips);
                    }).keydown(function(ev) {
                        var ev = ev||event;
                        if(ev.keyCode==13) $('#searchBtn').trigger("click");
                        
                    });
                  



        });

        
    </script>
    

</body>

</html>


